//警告框
function myFunction(){
	document.querySelector("body").style.background = "blue"
	alert("我警告你不要碰我东西！");
}








function button(){
	document.querySelector("body").style.background = "yellow"
	var x;
	var r=confirm("按下按钮！")
	if (r = true){
		x="你按下的确定按钮";
	}
	else{
		x="你按下了取消按钮";
	}
	document.getElementById("demo").innerHTML=x;
}




function duihua(){
	document.querySelector("body").style.background = "red"
	var x;
	var person=prompt("请输入你的名字")
	if (person!=null && person!=""){
		x = "我是 " + person + "! 的爸爸"
		document.getElementById("demo2").innerHTML=x;
	}
}


//var mmp1 = 11;
//var mmp2 = 22;
//alert(mmp1 + mmp2);



//function mvp(a,b){
//	var c = a + b;
//	return c;
//}
//alert(mvp(11,12));




//function scr(a){
//	alert(a);
//}
//scr(20)


//function scr(a,b){
//	alert(a + b);
//}
//scr(11,12)

//function bbb(a,b){
//	return a + b;
//}
//bbb(1,1)

var text1 = document.querySelector("#text1");
var text2 = document.querySelector(".text2");

text1.innerHTML = "已被重新赋值";
text2.innerHTML ="已被重新赋值*2";


var stu = {};

stu.name = "小明"
stu.xbi = "男"
stu.nl = "18"
stu.say = function(){
	return"我叫" + this.name +",是个"+this.xbi+"孩子，今年"+this.nl+"岁了"; 
}
 console.log(stu);
 console.log(stu.name);
 console.log(stu.say());
 alert(stu.say())
